package org.mikeliu.exp4.exp8;

import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main 
{
	public static void main(String[] args) 
	{
		Map<String, Integer> bookTreeMap=new TreeMap<>();
		Scanner scanner=new Scanner(System.in);
		String infoString=scanner.nextLine();
		String[] booksStrings=infoString.split("；");
		String[][] mapStrings=new String[booksStrings.length][2];
		for(int i=0;i<booksStrings.length;i++)
		{
			mapStrings[i]=booksStrings[i].split("：");
		}
		for(int i=0;i<mapStrings.length;i++)
		{
			bookTreeMap.put(mapStrings[i][0], Integer.parseInt(mapStrings[i][1].strip()));
		}
		Integer sum=0;
		
		for (Map.Entry<String, Integer> entry : bookTreeMap.entrySet()) {
			String key = entry.getKey();
			Integer val = entry.getValue();
			System.out.println(key+"--"+val);
			sum+=val;
		}
		System.out.println("总价格--"+sum);
		scanner.close();
	}
}
